package com.zwh.modules.datamax.eventbus;

import org.apache.logging.log4j.message.Message;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.google.common.eventbus.Subscribe;
import com.zwh.autoconfigure.eventbus.EventBusListener;
import com.zwh.modules.datamax.service.DataMaxService;

/**
 * @author zwh
 * @date 2020/11/4 11:58
 **/
@Component
@EventBusListener
public class EventChangeListener {
    private Logger log = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private DataMaxService dataMaxService;

    @Subscribe
    public void updateProjectProgress(EventChangeEvent event) throws InterruptedException {
        if(event.getProjectId() == null) {
            return;
        }
        System.out.println("测试事件发布模型事件消息为"+event.getProjectId());
        Thread.sleep(3000);
        log.warn("测试事件发布模型事件消息为：{1}",event.getProjectId());
    }
}
